473,439 Members | 5,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,439 software developers and data experts.

Creating Menus, Submenus and Menuitems at runtime

Hi Everybody,

This is the first timw I am entering into this Group.

I am developing a VB Project with an MDI form.

I want to display IE Favorites into my application. For this I need to
create Submenus and Menuitems dynamically. It is possible to create
menus using array index. But if I have multiple folders and files in
Favorites then using array index will not work.

Can anyone in this group help me ?

I need source code with an example.

Thanks & Regards
Venkatesh
Jul 17 '05 #1
1 11304
: I want to display IE Favorites into my application. For this I need to
: create Submenus and Menuitems dynamically. It is possible to create
: menus using array index.

Somewhat. In order to create a dynamic menu in VB you must have at least one
member already created at design time. The remaining items are added via the
Load statement, just as with control arrays. This means that to have a menu
that displays sublevels under main items (ie Favorites > Microsoft >
Development and Favorites > Microsoft > Office), you have to have an empty
template under the Favorites and Microsoft items. If the Office folder
contains Office > Word, Office> Excel and Office > Frontpage, then you will
need to have constructed your design time menu with a blank item at this new
sub level. IOW, if the favorites folder contains items n levels deep, your
app has to have blank items n items deep in order to display the menu as it
would appear in IE.

And from what I can see in a quick scan of the MSDN, VB's Control.Add()
method, which provides for adding new controls at runtime without the need
for a template item, is not applicable to menus.
: But if I have multiple folders and files in
: Favorites then using array index will not work.

It is possible to do this (the above) using Windows API, then attaching the
menu to the app, however the VB form will be unaware it has a menu and all
coding for detection of the user's selection would need to be made through
subclassing.

Many VB apps I've seen that require such dynamic menu functionality,
especially for favorites, have resorted to using other controls such as a
treeview displayed in response to a toolbar item click. Not a perfect
solution however.
--

Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.
"Venkatesh" <mv**************@hotmail.com> wrote in message
news:c7**************************@posting.google.c om...
: Hi Everybody,
:
: This is the first timw I am entering into this Group.
:
: I am developing a VB Project with an MDI form.
:
: I want to display IE Favorites into my application. For this I need to
: create Submenus and Menuitems dynamically. It is possible to create
: menus using array index. But if I have multiple folders and files in
: Favorites then using array index will not work.
:
: Can anyone in this group help me ?
:
: I need source code with an example.
:
: Thanks & Regards
: Venkatesh
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Raj Singh Sisodia | last post by:
Hello Sir/Madam, I am tring to create Menu and toolbar controls that looks like the one used in Office Xp. I have trird using the Menu class to create my own myMainMenu and MyMenuItem but in Ide...
0
by: Andrew Baker | last post by:
Have a look at the code below. It's a really simple example where I have added two controls to a form, a textbox and a combo box. Both add owner drawn context menus to the controls, but the...
4
by: ssg31415926 | last post by:
I've got a ListView which can show many different types of object. I need to display a ContextMenu whose MenuItems depend on the object type. I was planning to pre-create the ContextMenus when...
5
by: Sandy | last post by:
How do you create menu items with submenus? An example of what I'm referring to are the microsoft menus to the left of this page with the arrows that show additional topics. -- Sandy
1
by: paulakeijzers | last post by:
I've got a problem with asp.net i am trying to make a menu control. and have searched the web for serveral controls but they don't work correctly. I am pretty new to asp.net building. What am i...
4
by: Ray Cassick \(Home\) | last post by:
I am in a bit of a bind. I can't believe I cannot figure this out but I have been at it all day and it is just not coming to me. I am building menus on a form based upon an XML file. I have...
0
by: ssg31415926 | last post by:
I have a list view which contains various object types and I need to create a context menu with menu items dependent on the object type. I can detect the object type at MouseDown. I've written...
12
by: Steve_Black | last post by:
I posted a similar message earlier but we've geared away from the original topic somewhat so I thought I'd post again in hopes of getting input from others. I am creating a MenuStrip...
2
N002199B
by: N002199B | last post by:
Hie Guru's I am trying to write code that can be re-used by simple calls to build menus and submenus on mobile devices. I have heard about the cascading menus design pattern, but do not...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.